import axios from '@/libs/axios1.js'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }

//获取列表
export const getTaskList = params => {
    return axios({
        url: `/cipher/task`,
        method: 'get',
        params:params,
        headers:jsonHeaders
      })
}

//创建任务
export const createTask = params => {
  return axios({
      url: `/cipher/task`,
      method: 'post',
      data:params,
      headers:jsonHeaders
    })
}

//查询部署成功工程下的虚拟机
export const getVirtualSuccess = (params,projectId) => {
  return axios({
      url: `/topo-edit/deployed/projects/${projectId}/vms`,
      method: 'get',
      params:params,
      headers:jsonHeaders
    })
}

//查询所有的部署成功的工程

export const getAllProject = (params) => {
  return axios({
      url: `/topo-edit/projects`,
      method: 'get',
      params:params,
      headers:jsonHeaders
    })
}

//测评任务绑定虚拟机
export const bindVirtual = (params,taskId) => {
  return axios({
      url: `/cipher/taskVmLink/${taskId}`,
      method: 'put',
      data:params,
      headers:jsonHeaders
    })
}

//查询测评任务绑定的虚拟机
export const getBindVirtual = (params,taskId) => {
  return axios({
      url: `/cipher/taskVmLink/${taskId}`,
      method: 'put',
      data:params,
      headers:jsonHeaders
    })
}
